package org.madgecko.api.service.impl;

import org.madgecko.api.dao.iface.IRecordDao;
import org.madgecko.api.model.Record;
import org.madgecko.api.service.iface.IRecordService;
import org.madgecko.basic.model.Pager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Author       : MadFrog
 * Date         : 2019/6/16 16:34
 * Description  :
 */
@Service
public class RecordService implements IRecordService {

    @Autowired
    private IRecordDao recordDao;

    @Override
    public Record load(Integer id) {
        return recordDao.load(id);
    }

    @Override
    public void update(Record record) {
        recordDao.update(record);
    }

    @Override
    public Record add(Record record) {
        return recordDao.add(record);
    }

    @Override
    public Pager<Record> findByMember(Integer memberId) {
        return recordDao.findByMember(memberId);
    }

    @Override
    public Long countRecordByMember(Integer memberId) {
        return recordDao.countRecordByMember(memberId);
    }
}
